package com.okwanshiwu.payment.common;

import com.okwanshiwu.dao.AppPayDao;
import com.okwanshiwu.pojo.pay.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * 订单处理类
 * 此类集合了所有的处理方法
 * @author
 * @create 2017-08-04 15:21
 **/
@Component
public class HandlerUtil {

	private static AppPayDao appPayDao;

	@Autowired
	private AppPayDao dao;

	@PostConstruct
	public void init(){
		appPayDao = this.appPayDao;
	}

	/**
	 * 插入正价或倒贴服务购买信息
	 * @param commonResult
	 * @return
	 */
	public static boolean insertOrderInfo(CommonResult commonResult){
		//验证是否插入过
		int i = appPayDao.checkPayExsit(commonResult.getAliAndWx());
		if(i==0){
			int j = appPayDao.insertOrderInfo(commonResult);
			if(j==1){
				return true;
			}
		}
		return false;
	}

	/**
	 * 插入微信购买订单信息
	 * @param commonResult
	 * @return
	 */
	public static boolean insertWxOrderInfo(CommonResult commonResult){



		return false;
	}



}
